<?php
$slug = pods_url_variable('last');
$pods = new Pod('users',$slug);
$users_name = $pods->get_field('name');
$users_brands = $pods->get_field('favorite_brands.name');

if(!empty($users_brands))
{
  $count = count($users_brands);
  if($count == '1')
  {
      $desc_brands = ucwords(stripslashes($users_brands));
  }
  else
  {
    for($i=0;$i<$count;$i++)
    {
        $desc_brands .= ucwords(stripslashes($users_brands[$i]));
        if($i != ($count - 1))
        {
            $desc_brands .= ', ';
        }
    }
  }
}
else
{
  $FBrands= new Pod('brand');
  $FBrands->page = 1;
  $FBrands->search = false;
  $FBrands->findRecords('id DESC', 6, "t.featured = '1'");
  while ($FBrands->fetchRecord())
  {
   $brand_name []= $FBrands->get_field('name');
  }
  
  $count = count($brand_name);
  if($count == '1')
  {
      $desc_brands = ucwords(stripslashes($brand_name));
  }
  else
  {
    for($i=0;$i<$count;$i++)
    {
        $desc_brands .= ucwords(stripslashes($brand_name[$i]));
        if($i != ($count - 1))
        {
            $desc_brands .= ', ';
        }
    }
  }
}

$pods->meta['title'] = ucwords($users_name)."'s Customized Offers";
$pods->meta['description'] = ucwords($users_name)."s Favorite Brands ".$desc_brands;
//$pods->meta['keywords'] = 'deals in '.ucwords($city).', snapdeal '.ucwords($city).', '.ucwords($city).' offer, shopping in '.ucwords($city).', online shopping '.ucwords($city).', daily deals in '.ucwords($city);

$pods->meta_properties['og:title'] = $pods->meta['title'];
$pods->meta_properties['og:type'] = 'website';
$pods->meta_properties['og:url'] = get_current_url();
$pods->meta_properties['og:description'] = $pods->meta['description'];
$pods->meta_properties['fb:admins'] = '100000630241649';
?>